package com.yzyz.utils.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import com.yzyz.bean.scenic.AttractionsBean;

public class AttractionsRowMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int arg1) throws SQLException {
		AttractionsBean att = new AttractionsBean();
		att.setId(rs.getInt("id"));
		att.setDescription(rs.getString("description"));
		att.setName(rs.getString("name"));
		att.setOwnerId(rs.getInt("ownerId"));
		att.setDate(new Date(rs.getTimestamp("date").getTime()));
		return att;
	}

}
